package com.esl.service.admin.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import com.esl.dao.admin.InfoDao;
import com.esl.dto.admin.PageInfo_Dto;
import com.esl.model.admin.Info;
import com.esl.service.admin.InfoManager;

@Service("infoManager")
public class InfoManagerImpl implements InfoManager {

	private InfoDao infoDao;

	@Override
	public void add(Info info) {
		infoDao.save(info);
	}

	@Override
	public void delete(Info info) {

	}

	@Override
	public void modify(Info info) {
		infoDao.saveOrUpdate(info);
	}

	@Override
	public void output() {

	}

	@Override
	public PageInfo_Dto load(int pageNow, int pageSize, String hql,
			String orderBy) {
		return infoDao.findByPageInfo(Info.class, pageNow, pageSize, hql,
				orderBy);
	}

	@Resource
	public void setInfoDao(InfoDao infoDao) {
		this.infoDao = infoDao;
	}

}
